﻿@model Telerik.Web.Mvc.GridModel<PluginModel>
@using Telerik.Web.Mvc.UI
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Administration/Content/images/ico-configuration.png")" alt="" />
        @T("Admin.Configuration.Plugins")
    </div>
    <div class="options">
        <a href="@Url.Action("ReloadList")" class="t-button">@T("Admin.Configuration.Plugins.ReloadList")</a>
    </div>
</div>
<table class="adminContent">
    <tr>
        <td>
            <h4>Manual plugin installation:</h4>
            <ol>
                <li>Upload the plugin to the /plugins folder in your nopCommerce directory. </li>
                <li>Restart your application. </li>
                <li>Scroll down through the list of plugins to find the newly installed plugin.
                </li>
                <li>Click on the 'Install' link to install the plugin. </li>
            </ol>
        </td>
    </tr>
    @*TODO display pop-up "waiting..." window (similar to installation wizard) when clicking on "install" or "uninstall"*@
    <tr>
        <td>
            @(Html.Telerik().Grid<PluginModel>()
                    .Name("plugins-grid")
                    .BindTo(Model.Data)
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.Group)
                            .Width(150)
                            .Centered();
                        columns.Bound(x => x.FriendlyName)
                             .Width(150)
                             .Centered();
                        columns.Bound(x => x.SystemName)
                            .Width(150)
                            .Centered();
                        columns.Bound(x => x.Version)
                            .Width(50)
                            .Centered();
                        columns.Bound(x => x.Author)
                            .Width(100)
                            .Centered();
                        columns.Bound(x => x.DisplayOrder)
                            .Width(50)
                            .Centered();
                        columns.Bound(x => x.Installed)
                             .Width(50)
                             .Template(x => x.Installed.ToString().ToLower())
                             .Centered();
                        columns.Bound(x => x.SystemName)
                            .Template(x =>
                                Html.ActionLink(x.Installed ? T("Admin.Configuration.Plugins.Fields.Uninstall").Text : T("Admin.Configuration.Plugins.Fields.Install").Text,
                                x.Installed ? "Uninstall" : "Install", new { systemName = x.SystemName }))
                            .Width(50)
                            .Centered()
                            .HeaderTemplate("Installation");
                    })
                    .Footer(false))
        </td>
    </tr>
</table>
